<?php /*a:2:{s:96:"D:\Other\phpstudy_pro\WWW\zhongchuang-yixing\public/themes/admin_simpleboot3/admin\test\add.html";i:1709833270;s:95:"D:\Other\phpstudy_pro\WWW\zhongchuang-yixing\public/themes/admin_simpleboot3/public\header.html";i:1709833882;}*/ ?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <!-- Set render engine for 360 browser -->
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- HTML5 shim for IE8 support of HTML5 elements -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
    <![endif]-->


    <link href="/themes/admin_simpleboot3/public/assets/themes/<?php echo cmf_get_admin_style(); ?>/bootstrap.min.css" rel="stylesheet">
    <link href="/themes/admin_simpleboot3/public/assets/simpleboot3/css/simplebootadmin.css" rel="stylesheet">
    <link href="/static/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <!--[if lt IE 9]>
    <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <style>
        form .input-order {
            margin-bottom: 0px;
            padding: 0 2px;
            width: 42px;
            font-size: 12px;
        }

        form .input-order:focus {
            outline: none;
        }

        .table-actions {
            margin-top: 5px;
            margin-bottom: 5px;
            padding: 0px;
        }

        .table-list {
            margin-bottom: 0px;
        }

        .form-required {
            color: red;
        }
    </style>
    <script type="text/javascript">
        //全局变量
        var GV = {
            ROOT: "/",
            WEB_ROOT: "/",
            JS_ROOT: "static/js/",
            APP: '<?php echo app('request')->module(); ?>'/*当前应用名*/
        };
    </script>
    <script src="/themes/admin_simpleboot3/public/assets/js/jquery-1.10.2.min.js"></script>
    <script src="/themes/admin_simpleboot3/public/assets/layui/layui.js"></script>
    <link  href="/themes/admin_simpleboot3/public/assets/layui/css/layui.css" rel="stylesheet">
    <script src="/static/js/echarts.min.js"></script>

    <script src="/static/js/wind.js"></script>
    <script src="/themes/admin_simpleboot3/public/assets/js/bootstrap.min.js"></script>
    <script>
        Wind.css('artDialog');
        Wind.css('layer');
        $(function () {
            $("[data-toggle='tooltip']").tooltip({
                container:'body',
                html:true,
            });
            $("li.dropdown").hover(function () {
                $(this).addClass("open");
            }, function () {
                $(this).removeClass("open");
            });
        });
    </script>
    <?php if(APP_DEBUG): ?>
        <style>
            #think_page_trace_open {
                z-index: 9999;
            }
        </style>
    <?php endif; ?>
<style type="text/css">
    .pic-list li {
        margin-bottom: 5px;
    }
</style>
<script type="text/html" id="photos-item-tpl">
    <li id="saved-image{id}">
        <input id="photo-{id}" type="hidden" name="photo_urls[]" value="{filepath}">
        <input class="form-control" id="photo-{id}-name" type="text" name="photo_names[]" value="{name}"
               style="width: 200px;" title="图片名称">
        <img id="photo-{id}-preview" src="{url}" style="height:36px;width: 36px;"
             onclick="imagePreviewDialog(this.src);">
        <a href="javascript:uploadOneImage('图片上传','#photo-{id}');">替换</a>
        <a href="javascript:(function(){$('#saved-image{id}').remove();})();">移除</a>
    </li>
</script>
<script type="text/html" id="files-item-tpl">
    <li id="saved-file{id}">
        <input id="file-{id}" type="hidden" name="file_urls[]" value="{filepath}">
        <input class="form-control" id="file-{id}-name" type="text" name="file_names[]" value="{name}"
               style="width: 200px;" title="文件名称">
        <a id="file-{id}-preview" href="{preview_url}" target="_blank">下载</a>
        <a href="javascript:uploadOne('文件上传','#file-{id}','file');">替换</a>
        <a href="javascript:(function(){$('#saved-file{id}').remove();})();">移除</a>
    </li>
</script>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li><a href="<?php echo url('Test/index'); ?>">文章管理</a></li>
        <li class="active"><a href="<?php echo url('Test/add'); ?>">添加文章</a></li>
    </ul>

    <form action="<?php echo url('Test/addPost'); ?>" method="post" class="form-horizontal js-ajax-form margin-top-20">
        <div class="row">
            <div class="col-md-9">
                <table class="table table-bordered">


                    <tr>
                        <th class="col-md-1">标题<span class="form-required">*</span></th>
                        <td>
                            <input class="form-control" type="text" name="post[post_title]"
                                   id="title" required value="" placeholder="请输入标题"/>
                        </td>
                    </tr>


                    <tr>
                        <th class="col-md-1">单选<span class="form-required">*</span></th>
                        <td>
                            <select class="form-control" name="admin_settings[admin_theme]"   id="input-site_admin_theme">

                                    <option value="1" >单选1</option>
                                    <option value="1" >单选2</option>
                                    <option value="1" >单选3</option>

                            </select>
                        </td>
                    </tr>


                    <tr>
                        <th class="col-md-1">多选<span class="form-required">*</span></th>
                        <td>

                            <label class="checkbox-inline">
                                <input value="1" type="checkbox" name="role_id[]"  > 111
                            </label>
                            <label class="checkbox-inline">
                                <input value="2" type="checkbox" name="role_id[]"  > 222
                            </label>
                        </td>
                    </tr>

                    <tr>
                        <th class="col-md-1">单选<span class="form-required">*</span></th>
                        <td>

                            <label class="radio-inline">
                                <input type="radio" name="status" value="1"> <?php echo lang('ENABLED'); ?>
                            </label>
                            <label class="radio-inline">
                                <input type="radio" name="status" value="0"> <?php echo lang('DISABLED'); ?>
                            </label>
                        </td>
                    </tr>


                    <tr>
                        <th class="col-md-1">简介<span class="form-required">*</span></th>
                        <td>
                            <textarea type="text" class="form-control" id="input-remark" name="remark"></textarea>
                        </td>
                    </tr>


                    <tr>
                        <th>单图<span class="form-required">*</span></th>
                        <td>
                            <input type="hidden" name="post[more][thumbnail]" id="thumbnail" value="">
                            <a href="javascript:uploadOneImage('图片上传','#thumbnail');">
                                <img src="/themes/admin_simpleboot3/public/assets/images/default-thumbnail.png"
                                     id="thumbnail-preview"
                                     width="35" style="cursor: pointer"/>
                            </a>
                            <input type="button" class="btn btn-sm btn-cancel-thumbnail" value="取消图片">
                        </td>
                    </tr>

                    <tr>
                        <th>多图</th>
                        <td>
                            <ul id="photos" class="pic-list list-unstyled form-inline"></ul>
                            <a href="javascript:uploadMultiImage('图片上传','#photos','photos-item-tpl');"
                               class="btn btn-default btn-sm">选择图片</a>
                        </td>
                    </tr>


                    <tr>
                        <th>内容</th>
                        <td>
                            <script type="text/plain" id="content" name="post[post_content]"></script>
                        </td>
                    </tr>



                    <tr>
                        <th>附件</th>
                        <td>
                            <ul id="files" class="pic-list list-unstyled form-inline">
                            </ul>
                            <a href="javascript:uploadMultiFile('附件上传','#files','files-item-tpl','file');"
                               class="btn btn-sm btn-default">选择文件</a>
                        </td>
                    </tr>

                    <tr>
                        <th>音频</th>
                        <td class="form-inline">
                            <input id="file-audio" class="form-control" type="text" name="post[more][audio]"
                                   value="<?php echo (isset($post['more']['audio']) && ($post['more']['audio'] !== '')?$post['more']['audio']:''); ?>" placeholder="请上传音频文件" style="width: 200px;">
                            <?php if(!(empty($post['more']['audio']) || (($post['more']['audio'] instanceof \think\Collection || $post['more']['audio'] instanceof \think\Paginator ) && $post['more']['audio']->isEmpty()))): ?>
                                <a id="file-audio-preview" href="<?php echo cmf_get_file_download_url($post['more']['audio']); ?>"
                                   target="_blank">下载</a>
                            <?php endif; ?>

                            <a href="javascript:uploadOne('文件上传','#file-audio','audio');">上传</a>
                        </td>
                    </tr>

                    <tr>
                        <th>视频</th>
                        <td class="form-inline">
                            <input id="file-video" class="form-control" type="text" name="post[more][video]"
                                   value="<?php echo (isset($post['more']['video']) && ($post['more']['video'] !== '')?$post['more']['video']:''); ?>" placeholder="请上传视频文件" style="width: 200px;">
                            <?php if(!(empty($post['more']['video']) || (($post['more']['video'] instanceof \think\Collection || $post['more']['video'] instanceof \think\Paginator ) && $post['more']['video']->isEmpty()))): ?>
                                <a id="file-video-preview" href="<?php echo cmf_get_file_download_url($post['more']['video']); ?>"
                                   target="_blank">下载</a>
                            <?php endif; ?>
                            <a href="javascript:uploadOne('文件上传','#file-video','video');">上传</a>
                        </td>
                    </tr>

                </table>

                <?php 
    \think\facade\Hook::listen('portal_admin_article_edit_view_main',null,false);
 ?>
                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-10">
                        <button type="submit" class="btn btn-primary js-ajax-submit"><?php echo lang('ADD'); ?></button>
                        <a class="btn btn-default" href="<?php echo url('AdminArticle/index'); ?>"><?php echo lang('BACK'); ?></a>
                    </div>
                </div>
            </div>

        </div>
    </form>
</div>
<script type="text/javascript" src="/static/js/admin.js"></script>
<script type="text/javascript">
    //编辑器路径定义
    var editorURL = GV.WEB_ROOT;
</script>
<script type="text/javascript" src="/static/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="/static/js/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript">
    $(function () {

        editorcontent = new baidu.editor.ui.Editor();
        editorcontent.render('content');
        try {
            editorcontent.sync();
        } catch (err) {
        }

        $('.btn-cancel-thumbnail').click(function () {
            $('#thumbnail-preview').attr('src', '/themes/admin_simpleboot3/public/assets/images/default-thumbnail.png');
            $('#thumbnail').val('');
        });

    });


</script>
</body>
</html>
